<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022/6/18
  Time: 23:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h3>欢迎来到员工添加页面</h3>
<%
    pageContext.setAttribute("ctp", request.getContextPath());
%>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/employee.css" type="text/css"/>
<script src="${pageContext.request.contextPath}/scripts/jquery-3.0.0.js"></script>
<table border="1" cellpadding="5" cellspacing="0" class="addtable">
    <form:form action="${ctp}/emp" modelAttribute="employee" method="POST">
        <caption>员工添加列表</caption>
        <tr>
            <td>员工姓名</td>
            <td>
                <form:input path="lastName"/>
                <span style="color: red">
                    ${errorInfo.lastName}
                </span>
            </td>
        </tr>
        <tr>
            <td>性别</td>
            <td>男：<form:radiobutton path="gender" value="1"/>
                女：<form:radiobutton path="gender" value="2"/></td>
        </tr>
        <tr>
            <td>员工邮箱</td>
            <td>
                <form:input path="email"/>
                <span style="color: red">
                        ${errorInfo.email}
                </span>


            </td>
        </tr>
        <tr>
            <td>部门</td>
            <td>
                <form:select path="department.id"
                             items="${depts}"
                             itemLabel="departname"
                             itemValue="id">

                </form:select>
            </td>
        </tr>
        <tr>
            <td colspan="2"><input type="submit" value="保存"/></td>
        </tr>

    </form:form>
</table>
</body>
</html>
